package com.zxkj.domain.mapper;

import com.zxkj.domain.entity.DocumentAddress;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2017/10/11.
 */
@Service
public class DocumentAddressServiceImpl implements DocumentAddressService {

    @Autowired
    @Qualifier("primaryJdbcTemplate")
    private JdbcTemplate jdbcTemplate;

    @Override
    public List<DocumentAddress> getListByDocmentId(String docment_id) {
        StringBuilder sb = new StringBuilder();
        sb.append("select * from document_address where Document_ID=?");
        return jdbcTemplate.query(sb.toString(), new BeanPropertyRowMapper(DocumentAddress.class), docment_id);
    }

}
